import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/view/Login.vue'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/login'

    },
    {
      path: '/login',
      name: 'login',
      component: Login

    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/view/Home.vue'),
      children: [{
        path: 'detail',
        component: () => import('@/view/Detail.vue'),
      },
      {
        path: 'form',
        component: () => import('@/view/Form.vue'),
      },
      ]
    }
  ]
})